package com.mob.tools;

import android.os.Looper;
import android.os.Process;

public class MobHandlerThread extends Thread
{
  private Looper mLooper;
  private int mPriority;
  private int mTid = -1;

  public MobHandlerThread()
  {
    this.mPriority = 0;
  }

  public MobHandlerThread(int paramInt)
  {
    this.mPriority = paramInt;
  }

  public Looper getLooper()
  {
    if (!isAlive())
      return null;
    try
    {
      while (isAlive())
      {
        Looper localLooper = this.mLooper;
        if (localLooper != null)
          break;
        try
        {
          wait();
        }
        catch (InterruptedException localInterruptedException)
        {
        }
      }
      return this.mLooper;
    }
    finally
    {
    }
  }

  public int getThreadId()
  {
    return this.mTid;
  }

  protected void onLooperPrepared()
  {
  }

  public boolean quit()
  {
    Looper localLooper = getLooper();
    if (localLooper != null)
    {
      localLooper.quit();
      return true;
    }
    return false;
  }

  public void run()
  {
    this.mTid = Process.myTid();
    Looper.prepare();
    try
    {
      this.mLooper = Looper.myLooper();
      notifyAll();
      Process.setThreadPriority(this.mPriority);
      onLooperPrepared();
      Looper.loop();
      this.mTid = -1;
      return;
    }
    finally
    {
    }
  }
}

/* Location:           C:\Users\user\Desktop\dd28_pcdd720\classes_dex2jar.jar
 * Qualified Name:     com.mob.tools.MobHandlerThread
 * JD-Core Version:    0.6.2
 */